package cn.aishu.common;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class ResponseModel {

    private boolean isSuccess; // 是否成功
    private String message; // 返回消息
    private JSONObject responseData; // 返回的其它数据

    public ResponseModel() {
        this.isSuccess = true;
    }

    public ResponseModel(String message) {
        this.isSuccess = true;
        this.message = message;
    }

    public ResponseModel(boolean isSuccess, String message) {
        this.isSuccess = isSuccess;
        this.message = message;
    }

    public ResponseModel(boolean isSuccess, String message, JSONObject responseData) {
        this.isSuccess = isSuccess;
        this.message = message;
        this.responseData = responseData;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public JSON getResponseData() {
        return responseData;
    }

    public void setResponseData(JSONObject responseData) {
        this.responseData = responseData;
    }

    @Override
    public String toString() {
        return "ResponseModel{" +
                "isSuccess=" + isSuccess +
                ", message='" + message + '\'' +
                ", responseData=" + responseData.toJSONString() +
                '}';
    }
}
